﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;

namespace PcArduinoControl
{
	public class ArduinoConnectTimeoutException :
		TimeoutException
	{
		const string cDefaultMessage = 
			"The connecting of the Arduino IO Board has timed out.";

		public TimeSpan Timeout { get; private set; }

		public ArduinoConnectTimeoutException() :
			base(cDefaultMessage)
		{ }

		public ArduinoConnectTimeoutException(string message) :
			base(message)
		{ }

		public ArduinoConnectTimeoutException(string message, Exception innerException) :
			base(message, innerException)
		{ }

		public ArduinoConnectTimeoutException(TimeSpan time) :
			base(cDefaultMessage)
		{
			Timeout = time;
		}

		public ArduinoConnectTimeoutException(string message, TimeSpan time) :
			base(message)
		{
			Timeout = time;
		}

		public ArduinoConnectTimeoutException(string message, Exception innerException, TimeSpan time) :
			base(message, innerException)
		{
			Timeout = time;
		}

		protected ArduinoConnectTimeoutException(SerializationInfo info, StreamingContext context) :
			base(info, context)
		{ }
	}
}
